package com.cleaningcloud.cld.service.impl;

import java.util.List;
import com.cleaningcloud.common.core.utils.DateUtils;
import com.cleaningcloud.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cleaningcloud.cld.mapper.CldJobCategoryMapper;
import com.cleaningcloud.cld.domain.CldJobCategory;
import com.cleaningcloud.cld.service.ICldJobCategoryService;

/**
 * 职别基数Service业务层处理
 * 
 * @author cleaningcloud
 * @date 2024-10-23
 */
@Service
public class CldJobCategoryServiceImpl implements ICldJobCategoryService 
{
    @Autowired
    private CldJobCategoryMapper cldJobCategoryMapper;

    /**
     * 查询职别基数
     * 
     * @param jobCategoryId 职别基数主键
     * @return 职别基数
     */
    @Override
    public CldJobCategory selectCldJobCategoryByJobCategoryId(Long jobCategoryId)
    {
        return cldJobCategoryMapper.selectCldJobCategoryByJobCategoryId(jobCategoryId);
    }

    /**
     * 查询职别基数列表
     * 
     * @param cldJobCategory 职别基数
     * @return 职别基数
     */
    @Override
    public List<CldJobCategory> selectCldJobCategoryList(CldJobCategory cldJobCategory)
    {
        return cldJobCategoryMapper.selectCldJobCategoryList(cldJobCategory);
    }

    /**
     * 新增职别基数
     * 
     * @param cldJobCategory 职别基数
     * @return 结果
     */
    @Override
    public int insertCldJobCategory(CldJobCategory cldJobCategory)
    {
        cldJobCategory.setCreateTime(DateUtils.getNowDate());
        cldJobCategory.setCreateId(SecurityUtils.getUserId());
        cldJobCategory.setCreateName(SecurityUtils.getUsername());
        cldJobCategory.setFlag(0L);
        return cldJobCategoryMapper.insertCldJobCategory(cldJobCategory);
    }

    /**
     * 修改职别基数
     * 
     * @param cldJobCategory 职别基数
     * @return 结果
     */
    @Override
    public int updateCldJobCategory(CldJobCategory cldJobCategory)
    {
        return cldJobCategoryMapper.updateCldJobCategory(cldJobCategory);
    }

    /**
     * 批量删除职别基数
     * 
     * @param jobCategoryIds 需要删除的职别基数主键
     * @return 结果
     */
    @Override
    public int deleteCldJobCategoryByJobCategoryIds(Long[] jobCategoryIds)
    {
        return cldJobCategoryMapper.deleteCldJobCategoryByJobCategoryIds(jobCategoryIds);
    }

    /**
     * 删除职别基数信息
     * 
     * @param jobCategoryId 职别基数主键
     * @return 结果
     */
    @Override
    public int deleteCldJobCategoryByJobCategoryId(Long jobCategoryId)
    {
        return cldJobCategoryMapper.deleteCldJobCategoryByJobCategoryId(jobCategoryId);
    }
}
